package com.purchase.order.service;

import com.purchase.common.exception.file.InvalidExtensionException;
import com.purchase.manage.damian.*;
import com.purchase.manage.damian.DAO.QuotationDAO;
import com.purchase.manage.damian.VO.OrderAllQuotationVO;
import com.purchase.manage.damian.VO.OrderQuotationVO;
import com.purchase.manage.damian.VO.OrderVO;
import com.purchase.order.domain.DAO.OrderDAO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.rmi.ServerException;
import java.text.ParseException;
import java.util.List;

public interface IOrderService {

    //采购员查看发布的订单
    List<OrderDAO> selectreleaseList(String type,Long orderId,String name);

    //查看工程类订单详细物资
    List<OrderProjectList> selectReleaseMaterialsListProject(Long orderId);

    //查看商品类订单详细物资
    List<StoreQuotationList> selectReleaseMaterialsListOther(Long orderId);

    //删除订单
    void deleteOrder(Long orderId);

    //供应商查看发布的订单
    List<OrderList> bidList(String type) throws ParseException;

    //删除供应商上传的询价单
    void deleteQutation(Long orderId, String type) throws ServerException;

    //招标结束更改订单状态
    void changeState();

    //查看招标详情 中 工程类询价单
    List<OrderProject> getQutationProjectInfo(OrderList orderDAO);

    //查看招标详情 中 商品类询价单
    List<StoreQuotation> getQutationOther(OrderList orderList) throws ParseException;

    //中标
    void successBid(Long orderId,Long supplierId) throws ServerException;

    //查看所有订单
    List<OrderDAO> selectList(String type, Long orderId, String materialTypeName,String state);

    //供应商查看所有工程询价单
    List<QuotationDAO> supplierQuotationListProject(Long orderId, String name);

    //供应商查看所有商品询价单
    List<QuotationDAO> supplierQuotationListOther(Long orderId, String name);

    //历史比价
    List<StoreQuotation> priceComparison(String name);

    //添加商品类订单
    void addStoreOrder(OrderVO orderVO) throws ServerException, ParseException;
    //添加工程类订单
    void addProjectOrder(OrderVO orderVO) throws ServerException, ParseException;

    //供应商手动添加工程类订单
    OrderProject insertSupplierAddProject(OrderQuotationVO orderQuotationVO) throws IOException, InvalidExtensionException;

    //供应商手动添加商品类订单
    StoreQuotation insertSupplierAddstore(OrderQuotationVO orderQuotationVO) throws IOException, InvalidExtensionException;

    List<OrderAllQuotationVO> allQuotation(String name, Long type);

    //采购员确认收到货
    void deliveryOfGoods(Long orderId) throws ServerException;

    //采购员可查看某一订单未报价状态的供应商
    List<SysSupplierState> selectStateList(Long orderId, String state) throws ServerException;


    List<StoreQuotationList> historyList(HttpServletResponse response, MultipartFile file) throws IOException;

    void test();

    //提醒供应商报价
    void remind(String supplierId);

    //生成外部链接
    String waibuUrl(Long orderId) throws ServerException;
}
